//
//  UITextField+Placeholder.m
//  ITC_iOS
//
//  Created by iBenz on 2018/9/1.
//  Copyright © 2018年 Benz.L. All rights reserved.
//

#import "UITextField+Placeholder.h"

@implementation UITextField(Placeholder)
@dynamic placeholderColor;

- (void)setPlaceholderColor:(UIColor *)placeholderColor {
    if (!self.placeholder) {
        self.placeholder = @" ";
        [self setValue:placeholderColor forKeyPath:@"_placeholderLabel.textColor"];
        self.placeholder = nil;
    }
    else {
        [self setValue:placeholderColor forKeyPath:@"_placeholderLabel.textColor"];
    }
}

@end
